//
// File:	EventManager.hpp
// Author:	Thomas TISSOT-DUPONT
// Login:	<thomas.tissotdupont@free.fr>
//
// Created:	02/05/2010 at 20:09:32
// Purpose:	
//
#ifndef EVENTMANAGER_HPP
#define EVENTMANAGER_HPP

#include "IEventManager.hpp"

class EventManager : public IEventManager
{
private:
	struct EventInfo
	{
		void				*pTarget;
		void				*pTargetEvent;
		void				*pCaller;
		std::string			callerFunctionName;
		EventConnection		eventConnection;
	};
	typedef std::list<EventInfo>			EventList;

public:
	void					Update();

public:
	void					Connect(void *pTarget, void *pTargetEvent, void *pCaller, const std::string &callerFunctionName, const EventConnection &eventConnection);
	void					Disconnect(void *pTarget, void *pTargetEvent, void *pCaller, const std::string &callerFunctionName);
	void					DisconnectTarget(void *pTarget);
	void					DisconnectEvent(void *pTargetEvent);
	void					DisconnectCaller(void *pCaller);
	void					DisconnectAll();

private:
	EventList				m_eventsList;
};

#endif //!EVENTMANAGER_HPP
